<?php
// $Id: results.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
global $base_url,$language;
  $url = $base_url . '/' . drupal_get_path('module', 'service');
//print_r($language);
//print "<pre>";print_r($items); print"</pre>";
 // print $nid->nid;
if($language->language=='ta'){
	$lang= '/ta';
}else{
 $lang='';
}
?>
	 <div class="view-header" id="viewmod_service_registration_<?php print $language->language?>">
		<div class="inner_tab_content">
			<div class = "inner_li"><a class="view_head_sel active" href="<?php print $base_url.$lang?>/service/deptname"><?php print t('Department wise')?></a></div>
		    <div class = "inner_li"><a class="view_head_nonsel" href="<?php print $base_url.$lang?>/service/atoz"><?php print t('Service wise')?></a></div>		
			<div class = "inner_li"><a class="view_head_nonsel" href="<?php print $base_url.$lang?>/service/category"><?php print t('Category wise')?></a></div>		
		    <div class = "inner_li"><a class="view_head_nonsel" href="<?php print $base_url.$lang?>/service/search"><?php print t('Search')?></a></div>
		</div>
		
	<div class="result_inner">
		<div>
		<?php  foreach($items as $row){?>
		<?php $dep = $row->field_src_dept['und'][0]['value'];
		my_db_change(1);
				$qury = db_query("select n.dept_name from depart_mst AS n where dep_id = '$dep'");
				foreach($qury  as $key){	
				//print_r($qury);			
					 $depname = $key->dept_name; 
				}
				my_db_change(0);
		?>
		<?php } ?>
		<?php if($depname != ''){?>
		<div class="res_dept"><span>
			<strong><?php echo t($depname)?></strong></span>
		<?php } ?>
			<span class="backbut">
			<a href="<?php print $base_url.$lang;?>/service/deptname"><?php print t('Back')?></a></span>
		</div>
		
		<?php 
		$i=0;
		 foreach($items as $row){?>
			<div class="res_title_ch" style="">
				 <p><a href='<?php echo $base_url.$lang;?>/service/dept/<?php  echo $row->nid.'/'.$row->field_src_org['und'][0]['value']; ?>'>
						<?php echo  t($row->title) ?>
					</a>
				 </p>
			</div>			
		<?php $i++; } ?>
		<?php if($i == '0'){?>
			 <div class="no_record">No Results Found </div>
		<?php }	?>
	</div>
<div class="clr"></div>
</div>